package magie;

public class Sort {
	private String nom;
	private int niveau;
	private boolean combat = false;
	private int nbe;
	
	public Sort(EListeSort nomComplet){
		
		this.niveau = (int) (nomComplet.toString().charAt(1)) - 48;
		
		switch(nomComplet.toString().charAt(2)){
		case 'C' :
			this.combat = true;
			break;
		case 'U' :
			this.combat = false;
			break;
		default :
			this.combat = false;
		}
		
		this.nom = nomComplet.toString().substring(3);
		this.nom = this.nom.replace('_', ' ');
		this.nbe = 1;
	}
	
	public String getNom() {
		return nom;
	}
	
	public int getNiveau() {
		return niveau;
	}

	public int getNbe() {
		return nbe;
	}

	public void setNbe(int nbe) {
		this.nbe = nbe;
	}

	public boolean isCombat() {
		return combat;
	}

	public boolean equals (Sort s){
		if(this.nom == s.getNom())
			return true;
		else
			return false;
	}
	
	public String toString(){
		String res = "";
		
		if(this.nbe==1)
			res+= "   - ";
		else
			res+= "x" + this.nbe + " - ";
		res+= this.nom;
		
		return res;
	}
}
